﻿using System.Windows.Controls;
using ShellLight.Contract;
using ShellLight.ModuleExample.ViewModels;

namespace ShellLight.ModuleExample.Views
{
    public partial class ShowCustomerView : UserControl
    {
        private readonly UICommandContext context;

        public ShowCustomerView()
        {
            InitializeComponent();
        }

        public ShowCustomerView(UICommandContext context)
            : this()
        {
            this.context = context;

            if (!string.IsNullOrEmpty(this.context.Parameter))
            {
                DataContext = new ShowCustomerViewModel()
                    {
                        Number = this.context.Parameter,
                        Name = "James Bond",
                        Address = "Secret Street 7",
                        Email = "007@somwhere.com",
                        Phone = "007007007"
                    };
            }
        }
    }
}


